package main

import (
	"fmt"
)

func tryRecover() {
	defer func() {
		r := recover()
		if err, ok := r.(error); ok {
			fmt.Println("Error: ", err)
		} else {
			panic(fmt.Sprintf("i don't know what to do : %v", r))
		}
	}()

	//panic(errors.New("this is error "))

	//a := 0
	//b := 3/a
	//fmt.Println(b)

	panic("haha")
}

func main() {
	tryRecover()
}
